// 数据库配置文件
const { Sequelize } = require('sequelize');

// 创建sequelize实例
const sequelize = new Sequelize({
  database: process.env.DB_NAME || 'new_bilibili',
  username: process.env.DB_USER || 'new_bilibili',
  password: process.env.DB_PASSWORD || 'new_bilibili',
  host: process.env.DB_HOST || 'localhost',
  port: process.env.DB_PORT || 3306,
  dialect: 'mysql',
  logging: process.env.NODE_ENV === 'development' ? console.log : false,
  define: {
    timestamps: true,
    underscored: true,
    paranoid: false
  }
});

module.exports = sequelize;